#!/usr/bin/env python
#Get host by address

import socket, sys

try:
    result = socket.gethostbyaddr(sys.argv[1])

    print "Primary hostname:"
    print " " + result[0]


    print "\nAddress:"
    for item in result[2]:
        print " " + item

except socket.herror, e:
    print "Could not lookuo name: ", e
